<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <title>企动客服知识库</title>
    <link type="text/css" href="css/reset.css" rel="stylesheet"/> 
    <link type="text/css" href="css/style.css" rel="stylesheet"/> 
    <link rel="stylesheet" href="css/layui.css">
    <link rel="stylesheet" href="css/bootstrap.min.css">
    <link rel="stylesheet" href="css/zTreeStyle.css" type="text/css">
    <link rel="stylesheet" href="js/skin/default/layer.css">
    <script src="js/jquery.min.js"></script>
    <script src="js/layer.js"></script>
    <script src="js/common.js"></script>
    <script src="js/layui.js"></script>
    <script type="text/javascript" src="js/jquery.ztree.core.js"></script>
    <script language="javascript" type="text/javascript" src="My97DatePicker/WdatePicker.js"></script>
</head>
<body>
    <!-- 头部 -->
    <div class="header">
        <div class="user-info">
            <div class="usr">
                <span class="name">回显公众号名称</span>
                <i class="triangle"></i>
                <ul class="drop">
                    <li>
                        <a class="edi_data" href="javascript:;">
                            <span class="text">编辑当前账号资料</span>
                        </a>
                    </li>
                    <li>
                        <a class="man_gzh" href="javascript:;">
                            <span class="text">管理其他公众号</span>
                        </a>
                    </li>
                    <li>
                        <a class="return_sys" href="javascript:;">
                            <span class="text">返回系统</span>
                        </a>
                    </li>
                </ul>
            </div>
        </div>
    </div>
    <!-- 左侧菜单 -->
    <div class="sideBar">
        <a class="logo" href="javascript:;">
            <img src="img/logo.png">
        </a>
        <ul>
            <li class="barList">
                <a class="pic act clearfix" href="javascript:;">
                    <span class="icon"></span>
                    <span class="text">知识库</span>
                </a>
                <ul class="show">
                    <li class="twoMenuLi">
                        <a class="pic clearfix" href="zskzl.html">
                            <span class="icon"></span>
                            <span class="text">知识库管理</span>
                        </a>
                    </li>
                    <li class="twoMenuLi">
                        <a class="pic clearfix" href="gdgl.html">
                            <span class="icon"></span>
                            <span class="text">工单管理</span>
                        </a>
                    </li>
                    <li class="twoMenuLi">
                        <a class="pic act clearfix" href="cjwt.html">
                            <span class="icon"></span>
                            <span class="text">常见问题列表</span>
                        </a>
                    </li>
                    <li class="twoMenuLi">
                        <a class="pic clearfix" href="bq.html">
                            <span class="icon"></span>
                            <span class="text">标签列表</span>
                        </a>
                    </li>
                </ul>
            </li>
            <li class="barList">
                <a class="pic clearfix" href="yggl.html">
                    <span class="icon"></span>
                    <span class="text">员工管理</span>
                </a>
            </li>
            <li class="barList">
                <a class="pic clearfix" href="setting.html">
                    <span class="icon"></span>
                    <span class="text">设置中心</span>
                </a>
            </li>
        </ul>
    </div>
    <!-- 中间内容 -->
    <div class="mainContent clearfix">
        <div class="center-con clearfix">
            <h2 class="main-ttl">添加问题</h2>
            <div class="main-ctn clearfix" style="padding-bottom: 80px;">
                <div class="item clearfix">
                    <div class="l text-right">
                        <span class="c-red">*</span><span>问题：</span>
                    </div>
                    <div class="r">
                        <input type="text" style="width: 664px" class="input-text" name="input_q">
                    </div>
                </div>
                <div class="item clearfix">
                    <div class="l text-right">
                        <span>设为常见：</span>
                    </div>
                    <div class="r">
                        <div><input type="checkbox" name="is_cj"></div>
                    </div>
                </div>
                <div class="item clearfix">
                    <div class="r" style="margin-left: 80px;">
                        <button type="button" class="Btn" id="add_q">添加相似问题</button>
                    </div>
                </div>
                <div class="item clearfix s_fl">
                    <div class="l text-right">
                        <span class="c-red">*</span><span>选择分类：</span>
                    </div>
                    <div class="r">
                        <input type="text" style="width: 664px" class="input-text" name="select_class">
                    </div>
                    <div class="select_con clearfix">
                        <ul id="treeDemo" class="ztree"></ul>
                    </div>
                </div>
                <div class="item clearfix">
                    <div class="l text-right">
                        <span class="c-red">*</span><span>答案：</span>
                    </div>
                    <div class="r">
                        <div style="width: 664px;">
                          <form class="layui-form">
                            <div class="layui-form-item">
                              <textarea name="demo" id="demo" class="layui-hide">
                           dfgdg
                              </textarea>
                            </div>
                          </form>
                        </div>
                    </div>
                </div>
                <div class="item clearfix is_show">
                    <div class="l text-right">
                        <span>标签：</span>
                    </div>
                    <div class="r clearfix">
                        <ul class="clearfix flList">
                            <li><input type="checkbox" id="checkbox-1"><label for="#checkbox-1">标签标签标签</label></li>
                            <li><input type="checkbox" id="checkbox-1"><label for="#checkbox-1">标签标签标签</label></li>
                            <li><input type="checkbox" id="checkbox-1"><label for="#checkbox-1">标签标签标签</label></li>
                            <li><input type="checkbox" id="checkbox-1"><label for="#checkbox-1">标签标签标签</label></li>
                            <li><input type="checkbox" id="checkbox-1"><label for="#checkbox-1">标签标签标签</label></li>
                            <li><input type="checkbox" id="checkbox-1"><label for="#checkbox-1">标签标签标签</label></li>
                        </ul>
                    </div>
                </div>
                <div class="item clearfix mt20" style="position: absolute;left: 20px;bottom: 20px;">
                    <button type="submit" class="Btn" id="submit_Add">保存并继续添加</button>
                    <button type="submit" class="Btn ml10" id="submit">保存</button>
                    <button type="button" class="Btn ml10" id="return" onclick="window.history.go(-1);">返回</button>
                </div>
            </div>
        </div>
    </div>
    <!-- 底部内容 -->
    <div class="footerContent clearfix navbar-fixed-bottom">
Copyright@2012-2016 ibona.cn　All Right Reserved. 粤ICP备 14099207号-4 版权所有@深圳博纳移动信息技术有限公司 | 咨询热线：40007 22217 　公司总部：深圳福田区金地工业园127栋2层
    </div>
<script>
$(function(){
    //选择分类获取焦点
    $('input[name=select_class]').bind('click focus',function(){
        $('.select_con').show();
    })
    //失去焦点
    $('input[name=select_class]').bind('blur',function(){
        $('.select_con').hide();
    })
    $('#add_q').on('click',function(){
        var html='<div class="item clearfix">' +
            '<div class="l text-right">' +
                '<span>相似问题：</span>' +
            '</div>' +
            '<div class="r">' +
                '<input type="text" class="input-text" name="common_q">' +
                '<button type="button" class="Btn del_q ml10" onclick="del($(this))">删除</button>' +
            '</div>' +
        '</div>';
        $(this).parents('.item').before(html);
    })
    $('#submit').on('click',function(){
        var t_q=$('input[name=input_q]').val();
        var result=$('textarea[name=result]').val();
        if(t_q==''){
            layer.msg('请输入问题');
            return
        }
        if(result==''){
            layer.msg('请输入答案');
            return
        }
    })
})

function del(obj){
    obj.parent().parent().remove();
}
</script>

<script>
layui.use('layedit', function(){
  var layedit = layui.layedit;
  
  var index = layedit.build('demo', {
    //hideTool: ['image']
    uploadImage: {
      url: '/upload/test/'
      ,type: 'post'
    }
    //,tool: []
    //,height: 100
  });
  
});
</script>
<SCRIPT type="text/javascript">
        <!--
        var setting = {
            data: {
                simpleData: {
                    enable: true
                }
            }
        };

        var zNodes =[
            { id:1, pId:0, name:"pNode 1", open:true},
            { id:11, pId:1, name:"pNode 11"},
            { id:111, pId:11, name:"leaf node 111"},
            { id:112, pId:11, name:"leaf node 112"},
            { id:113, pId:11, name:"leaf node 113"},
            { id:114, pId:11, name:"leaf node 114"},
            { id:12, pId:1, name:"pNode 12"},
            { id:121, pId:12, name:"leaf node 121"},
            { id:122, pId:12, name:"leaf node 122"},
            { id:123, pId:12, name:"leaf node 123"},
            { id:124, pId:12, name:"leaf node 124"},
            { id:13, pId:1, name:"pNode 13 - no child", isParent:true},
            { id:2, pId:0, name:"pNode 2"},
            { id:21, pId:2, name:"pNode 21", open:true},
            { id:211, pId:21, name:"leaf node 211"},
            { id:212, pId:21, name:"leaf node 212"},
            { id:213, pId:21, name:"leaf node 213"},
            { id:214, pId:21, name:"leaf node 214"},
            { id:22, pId:2, name:"pNode 22"},
            { id:221, pId:22, name:"leaf node 221"},
            { id:222, pId:22, name:"leaf node 222"},
            { id:223, pId:22, name:"leaf node 223"},
            { id:224, pId:22, name:"leaf node 224"},
            { id:23, pId:2, name:"pNode 23"},
            { id:231, pId:23, name:"leaf node 231"},
            { id:232, pId:23, name:"leaf node 232"},
            { id:233, pId:23, name:"leaf node 233"},
            { id:234, pId:23, name:"leaf node 234"},
            { id:3, pId:0, name:"pNode 3 - no child", isParent:true}
        ];

        $(document).ready(function(){
            $.fn.zTree.init($("#treeDemo"), setting, zNodes);
        });
        //-->
    </SCRIPT>
</body>
</html>